# 斐波那契数
class Fibonacci(object):
    def __init__(self, num):
        self.first = 0
        self.second = 1
        self.num = num

    def generate_fibo(self):
        for i in range(self.num):
            yield self.first
            self.first, self.second = self.second, self.first + self.second

print(list(Fibonacci(10).generate_fibo()))
